<?php

namespace Wap\Controller;
use Think\Controller;

class StudentController extends HomeController
{

    public function index()
    {
        $major=M('major')->field('id,title')->select();
        $this->assign('major',$major);
        $this->display('index');
    }

    public function saveData(){
        if(IS_POST){
            $data=I('post.');
            $data['type']=1;
            $data['create_time']=time();
            $res = M('student_info')->add($data);
            if(!$res){
                $this->error ("提交出错");
            }else{
                $this->success ('提交成功！');
            }
        }
    }


}